﻿using Caliburn.Micro;
using Example.Entities;

namespace Example.Frontend.Customers
{
    public class CustomerViewModel : Conductor<IChild>.Collection.OneActive
    {
        private CustomerInfoViewModel _info;
        private CustomerInfoViewModel _info2;

        public CustomerViewModel()
        {           
        }

        protected override void OnInitialize()
        {
            base.OnInitialize();

            _info = new CustomerInfoViewModel();
            this.EnsureItem(_info);
            //Items.Add(_info);

            _info2 = new CustomerInfoViewModel();
            Items.Add(_info2);
        }
        
        public void SetCustomer(Customer cust)
        {
            _info.Customer = cust;
            _info2.Customer = cust;
        }
    }
}